package chapter09.exercise.test19;

import java.util.Random;

public class Coin implements Play {

    private static Random rand = new Random();

    public void play() {
        System.out.print("抛硬币: ");
        switch (rand.nextInt(2)) {
            case 0:
                System.out.println(Coinn.values()[0]);
                break;
            case 1:
                System.out.println(Coinn.values()[1]);
                break;

            default:
                break;
        }
    }

    enum Coinn {
        正面, 反面
    }
}
